import { createRouter, createWebHashHistory } from "vue-router";
export let asyncRoutes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        component: () =>
            import('../views/Home/Home.vue'),
        meta: {
            isShowNav: true
        }
    },
    {
        path: '/category',
        component: () =>
            import('../views/Category/Category.vue'),
        meta: {
            isShowNav: true
        }
    },
    {
        path: '/cart',
        component: () =>
            import('../views/Cart/Cart.vue'),
        meta: {
            isShowNav: true
        }
    },
    {
        path: '/user',
        component: () =>
            import('../views/User/User.vue'),
        meta: {
            isShowNav: true
        }
    },
    {
        path: '/login',
        component: () =>
            import('../views/Login/Login.vue'),
        meta: {
            isShowNav: true
        }
    },
    {
        path:'/info/:productId',
        component:()=>import('@/views/Info/Info.vue'),
        meta: {
            isShowNav: false
        }
    }
];
let router = createRouter({
    history: createWebHashHistory(),
    routes: [
        ...asyncRoutes,
        { path: '/:pathMath(.*)', redirect: '/' }
    ]
})
router.beforeEach((to, from, next) => {
    next()
});
export default router